package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.SchCourseTaskMapper;
import com.ruoyi.teach.domain.SchCourseTask;
import com.ruoyi.teach.service.ISchCourseTaskService;

/**
 * 课程任务[作业和考试]Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class SchCourseTaskServiceImpl implements ISchCourseTaskService 
{
    @Autowired
    private SchCourseTaskMapper schCourseTaskMapper;

    /**
     * 查询课程任务[作业和考试]
     * 
     * @param tId 课程任务[作业和考试]主键
     * @return 课程任务[作业和考试]
     */
    @Override
    public SchCourseTask selectSchCourseTaskByTId(Long tId)
    {
        return schCourseTaskMapper.selectSchCourseTaskByTId(tId);
    }

    /**
     * 查询课程任务[作业和考试]列表
     * 
     * @param schCourseTask 课程任务[作业和考试]
     * @return 课程任务[作业和考试]
     */
    @Override
    public List<SchCourseTask> selectSchCourseTaskList(SchCourseTask schCourseTask)
    {
        return schCourseTaskMapper.selectSchCourseTaskList(schCourseTask);
    }

    /**
     * 新增课程任务[作业和考试]
     * 
     * @param schCourseTask 课程任务[作业和考试]
     * @return 结果
     */
    @Override
    public int insertSchCourseTask(SchCourseTask schCourseTask)
    {
        schCourseTask.setCreateTime(DateUtils.getNowDate());
        return schCourseTaskMapper.insertSchCourseTask(schCourseTask);
    }

    /**
     * 修改课程任务[作业和考试]
     * 
     * @param schCourseTask 课程任务[作业和考试]
     * @return 结果
     */
    @Override
    public int updateSchCourseTask(SchCourseTask schCourseTask)
    {
        schCourseTask.setUpdateTime(DateUtils.getNowDate());
        return schCourseTaskMapper.updateSchCourseTask(schCourseTask);
    }

    /**
     * 批量删除课程任务[作业和考试]
     * 
     * @param tIds 需要删除的课程任务[作业和考试]主键
     * @return 结果
     */
    @Override
    public int deleteSchCourseTaskByTIds(Long[] tIds)
    {
        return schCourseTaskMapper.deleteSchCourseTaskByTIds(tIds);
    }

    /**
     * 删除课程任务[作业和考试]信息
     * 
     * @param tId 课程任务[作业和考试]主键
     * @return 结果
     */
    @Override
    public int deleteSchCourseTaskByTId(Long tId)
    {
        return schCourseTaskMapper.deleteSchCourseTaskByTId(tId);
    }
}
